package com.lxy.controller.admin;


import com.lxy.common.constant.HttpStatus;
import com.lxy.common.domain.AjaxResult;
import com.lxy.feign.SkuFeignClient;
import com.lxy.service.SkuService;
import com.lxy.vo.SkuVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "sku商品管理")
@RestController
@RequestMapping("/api")
public class SkuController implements SkuFeignClient {


    @Autowired
    SkuService skuService;

    @ApiOperation(value = "skuId查询")
    @GetMapping("/goods")
    @Override
    public AjaxResult queryBySkuId(Long skuId) {
        SkuVo skuVo = skuService.queryBySkuId(skuId);
        return new AjaxResult(HttpStatus.SUCCESS,"返回成功",skuVo);
    }
}
